package designPattern.command.undoCommand
{
	import flash.text.TextField;

	public class IncrementCommandWithUndo extends CommandWithUndo
	{
		private var receiver:TextField;
		public function IncrementCommandWithUndo(receiver:TextField)
		{
			super();
			this.receiver = receiver;
		}
		
		override public function execute():void
		{
			this.receiver.text = (Number(receiver.text) + 1).toString();	
			super.execute();
		}
		
		override public function undo():void
		{
			this.receiver.text = (Number(receiver.text) - 1).toString();
		}
	}
}